/**
 * 字典数据模型 
 * 
*/
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("sys_dict_data", {
        dict_code: {
            type: Sequelize.INTEGER,
            notNull: true,
            primaryKey: true,
            comment: '字典数据主键',
            autoIncrement: true, // 自增整形主键
        },
        id: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment:'层级id'
        },
        parentId: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment:'父级id',
            field:'parent_id'
        },
        dictSort: {
            type: Sequelize.INTEGER,
            notEmpty: true,
            comment:'排序',
            field:'dict_sort'
        },
        dictLabel: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment:'字典标签',
            field:'dict_label'
        },
        dictValue: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment:'字典键值',
            field:'dict_value'
        },
        dictType: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment:'字典类型',
            field:'dict_type'
        },
        isDefault: {
            type: Sequelize.STRING(2),
            defaultValue: 'N',
            comment:'是否为默认Y:是 N:否',
            field:'is_default'
        },
        status: {
            type: Sequelize.STRING(2),
            notEmpty: true, // 不能为空
            defaultValue: '0',
            comment: '状态 0:正常 1:停用'
        },
        createId: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment: '创建者',
            defaultValue:'admin',
            field:'create_id'
        },
        updateId: {
            type:  Sequelize.STRING,
            notEmpty: true,
            comment: '更新者',
            defaultValue:'admin',
            field:'update_id'
        },
        remark: {
            type:  Sequelize.STRING,
            comment: '备注',
        }
    })
}